<template>
  <div>
    <!-- 面包屑 -->
    <el-brand></el-brand>
    <!-- 添加按钮 -->
    <div>
      <el-button class="btn" type="primary" plain size="small" @click="add">添加</el-button>
    </div>
    <!-- 列表的渲染 -->
    <v-list @edit='edit'></v-list>
    <!-- 弹框的渲染 -->
    <v-dialog ref="dialogInfo" @cancel='cancel' :isShow="isShow" :isAdd='isAdd'></v-dialog>
  </div>
</template>

<script>
import vList from "./list";
import vDialog from "./dialog";
export default {
  data() {
    return {
      isShow: false,
      isAdd:true
    };
  },
  components: {
    vList,
    vDialog
  },
  methods: {
    add() {
      this.isShow = true;
      this.isAdd = true
    },
    cancel(e){
      this.isShow = e
    },
    edit(e){
      this.isShow = true;
      this.isAdd = false
      this.$refs.dialogInfo.lookup(e)
    }
  }
};
</script>

<style  scoped>
.btn {
  margin: 30px;
}
</style>
